#include<stdio.h>

int main()
{
	int n[5][5];
	int i,j,sum1=0,sum2=1;
	
	for(i=0;i<5;i++)
		for(j=0;j<5;j++)
			scanf("%d",&n[i][j]);
	
	for(i=0;i<5;i++)
	{
		sum1+=n[i][i];
		sum1+=n[i][5-i-1];
		if(i%2!=0)	continue;
		
		sum2*=n[i][i];
		if(i%2==0)
			sum2*=n[i][4-i];
	}
	
	sum1 -= n[2][2];
	sum2 /= n[2][2];
	printf("(1): %d\n(2): %d\n",sum1,sum2);
}
